package com.stottlerhenke.simbionic.api;

import java.util.ArrayList;

/**
 * <p>Description: A function declaration consists of a name, identifier, a return valued, and a list of
 * parameter specifications</p>
 */

public class SB_FuncSpec
{
  public SB_FuncSpec()
  {
    _parameterArray = new ArrayList();
  }

  /**
   * Creates the specified function declaration
   * @param name of the action/predicate
   * @param id of the action/predicate
   * @pram returnType of predicates, shoud be kInvalid for actions
   * @param parameters ArrayList of SB_FunParamSpec objects
   */
  public SB_FuncSpec(String name, int id, SB_VarType returnType, ArrayList parameters)
  {
    _functionName = name;
    _functionID = id;
    _returnType = returnType;
    _parameterArray = new ArrayList();
    _parameterArray.addAll(parameters);
  }

  /**
   * Creates the specified function declaration.  This version of the constructor
   * accepts class-types as return types.
   * @param name of the action/predicate
   * @param id of the action/predicate
   * @pram returnType of predicates, shoud be kInvalid for actions
   * @param parameters ArrayList of SB_FunParamSpec objects
   */
  public SB_FuncSpec(String name, int id, int returnType, ArrayList parameters)
  {
      _functionName = name;
      _functionID = id;
      _returnType = new SB_VarType(returnType);
      _parameterArray = new ArrayList();
      _parameterArray.addAll(parameters);      
  }

  public String getFunctionName() {return _functionName; }
  public int getFunctionID() {return _functionID;}

  public SB_VarType getReturnType() {return _returnType; }

  public ArrayList getParameterArray() {return _parameterArray;}

  private String _functionName;
  private int  _functionID;
  private SB_VarType _returnType;
  private ArrayList  _parameterArray;
}